package com.itheima;

import com.JDBCUtils;
import org.junit.Test;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class demo01 {
   @Test
    public void Test01() throws SQLException, ClassNotFoundException {
      //通过工具包查询user表
       Connection connection = JDBCUtils.getConnection();
       Statement statement = connection.createStatement();
       ResultSet set = statement.executeQuery("SELECT  * FROM  user ");
       //查看结果集合
       while (set.next()){
           System.out.println(set.getString("id")+":"+set.getString("username")+":"+set.getString("birthday")+":"+set.getString("address")+":"+set.getString("sex"));
       }
      JDBCUtils.Close(connection,statement,set);
   }
}
